from django.contrib.auth.models import AbstractUser
from django.db import models


# Create your models here.

class MyUser(AbstractUser):
    gender = models.CharField(max_length=20, null=True)
    nationality = models.CharField(max_length=20, null=True)
    age = models.IntegerField(default=0, null=True)
    join_group_age = models.IntegerField(null=True)
    belong_to_group = models.CharField(max_length=100, null=True)


class MyGroup(models.Model):
    full_name = models.CharField(max_length=100, null=True, unique=True)
    brief_name = models.CharField(max_length=100, null=True)
    create_time = models.DateTimeField(null=True)
    admin_name = models.CharField(max_length=100, null=True)
    user_num = models.IntegerField(null=True)


class News(models.Model):
    title = models.CharField(max_length=200, null=True)
    content = models.TextField(null=True)
    create_time = models.DateTimeField(null=True, auto_now_add=True)
    author = models.CharField(max_length=100, null=True)  # 发送者名字
    full_name = models.CharField(max_length=100, null=True)  # 所属组织
